﻿using Android.App;
using Android.OS;
using Android.Views;
using Android.Widget;
using Esri.ArcGISRuntime.ARToolkit;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Location;
using Esri.ArcGISRuntime.Mapping;
using System;
using System.Threading.Tasks;
using Resource = ARToolkit.SampleApp.Android.Resource;

namespace ARToolkit.SampleApp.Samples
{
    [Activity(
        Label = "GPS-assisted AR",
        Theme = "@style/Theme.AppCompat",
        ConfigurationChanges = global::Android.Content.PM.ConfigChanges.Orientation | global::Android.Content.PM.ConfigChanges.ScreenSize)]
    [SampleInfo(DisplayName = "Continuous GPS Full-scale AR", Description = "Uses the device's GPS to continously snap the origin to your current location. Best results are achieved with a very high-accuracy GPS, and a good compass alignment.")]
    public class FullScaleARSample : ARActivityBase
    {
        private Scene Scene;
        private double defaultDeviceElevationAboveTerrain = 1.5;
        TextView headingReadout;

        protected override ARSceneView? SetContentView()
        {
            SetContentView(Resource.Layout.fullscalear);            
            return FindViewById<ARSceneView>(Resource.Id.sceneView1);
        }

        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Configure ARView for 1:1 AR
            ARView.TranslationFactor = 1; // 1:1 AR Scale
            //ARView.UseCompass = true; // Attempt to align with north
            ARView.ViewpointChanged += ARView_ViewpointChanged; // Used for reporting the current heading on the UI
            ARView.LocationDataSource = new SystemLocationDataSource();
            TrackingMode = ARLocationTrackingMode.Continuous;

            headingReadout = FindViewById<TextView>(Resource.Id.headingText);

            //Configure scene
            Scene = new Scene(new Basemap(new Uri("https://www.arcgis.com/home/item.html?id=55ebf90799fa4a3fa57562700a68c405")));
            Scene.Basemap.BaseLayers[0].Opacity = .75;
            Scene.BaseSurface = new Esri.ArcGISRuntime.Mapping.Surface();
            Scene.BaseSurface.BackgroundGrid.IsVisible = false;
            Scene.BaseSurface.NavigationConstraint = NavigationConstraint.None;
            Scene.BaseSurface.ElevationSources.Add(new ArcGISTiledElevationSource(new Uri("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")));

            // ESRI Parking Lot data
            string json = "{\"layers\":[{\"featureSet\":{\"features\":[{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":1,\"PDOP\":1.7,\"VDOP\":1.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19683968799995,34.057871803000069,402.59600000000501,0.069699999992735684],[-117.19682152299998,34.057871342000055,402.55899999999383,0.069699999992735684],[-117.19678644499999,34.057872308000071,400.42500000000291,0.069699999992735684],[-117.19677167199995,34.057873393000079,400.41999999999825,0.070399999996880069],[-117.19677184499994,34.057873285000028,400.44199999999546,0.070000000006984919],[-117.19677084399996,34.057850335000069,400.39500000000407,0.070500000001629815],[-117.19678572699996,34.057850300000041,400.4210000000021,0.070300000006682239],[-117.19680230799997,34.057863208000072,400.43099999999686,2.5524000000004889]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.69999999999999996,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":2,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19688924199994,34.057845051000072,396.00999999999476,0.70110000000568107],[-117.19691206699997,34.057861635000052,393.8289999999979,0.58719999999448191]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":3,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19709317899998,34.057898785000077,390.89699999999721,0.070200000001932494],[-117.19709518699995,34.057900792000055,390.86100000000442,0.070099999997182749],[-117.19709740199994,34.057903405000047,390.84299999999348,0.070099999997182749],[-117.19710066999994,34.057903888000055,390.86299999999756,0.070099999997182749],[-117.19710346899996,34.057903349000071,390.83199999999488,0.069499999997788109],[-117.19710545699996,34.057902472000023,390.84100000000035,0.070200000001932494],[-117.19710703599998,34.057900407000034,390.85400000000664,0.070200000001932494],[-117.19710790699997,34.057897890000049,390.85099999999511,0.069499999997788109],[-117.19710751699995,34.057895282000061,390.83299999999872,0.070200000001932494],[-117.19709942199995,34.057875597000077,390.88499999999476,0.070300000006682239],[-117.19708943799998,34.057851823000078,390.96199999999953,0.070099999997182749],[-117.19712590699999,34.057840461000069,390.86299999999756,0.069499999997788109]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":4,\"PDOP\":2.5,\"VDOP\":2.3999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19709295999996,34.05789838000004,390.83000000000175,0.070300000006682239],[-117.19708247199998,34.057876162000071,390.86199999999371,0.070000000006984919],[-117.19707320799995,34.057855083000049,390.94400000000314,0.069399999993038364],[-117.19707055399999,34.057845890000067,391.0399999999936,0.070200000001932494],[-117.19707052599995,34.057843674000026,391.06900000000314,0.069499999997788109],[-117.19707175099995,34.057843002000027,391.07700000000477,0.069499999997788109],[-117.19707462699995,34.057840959000032,391.04399999999441,0.069499999997788109]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":5,\"PDOP\":2.2000000000000002,\"VDOP\":2,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19697829099999,34.057848867000075,391.13999999999942,0.070000000006984919],[-117.19701169399997,34.057923139000025,391.01799999999639,0.070300000006682239],[-117.19701210099998,34.057927611000025,390.9890000000014,0.069699999992735684],[-117.19701093799995,34.057930278000072,390.96099999999569,0.070399999996880069],[-117.19700704499996,34.057932484000048,390.92699999999604,0.069699999992735684],[-117.19700266699999,34.057933363000075,390.92999999999302,0.069699999992735684],[-117.19699890099997,34.057931729000074,390.95699999999488,0.069499999997788109],[-117.19699666499997,34.057928633000074,390.95699999999488,0.069399999993038364],[-117.19697741599998,34.057885002000035,391.02300000000105,0.070399999996880069]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":6,\"PDOP\":2,\"VDOP\":1.8,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19717198399997,34.058061375000079,390.38300000000163,0.069499999997788109],[-117.19714181499995,34.057986481000057,390.3469999999943,0.070200000001932494],[-117.19719249399998,34.057976059000055,390.29899999999907,0.070300000006682239],[-117.19727935399999,34.05794897100003,390.21300000000338,0.069499999997788109],[-117.19736158599994,34.057923555000059,390.11699999999837,0.070300000006682239],[-117.19748238499994,34.057887677000053,389.91700000000128,0.069699999992735684],[-117.19764639899995,34.057839027000057,389.81399999999849,0.095400000005611219]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":7,\"PDOP\":3,\"VDOP\":2.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19764733799997,34.057839637000029,390.09500000000116,0.069399999993038364],[-117.19758157399997,34.057860307000055,391.38800000000629,0.55299999999988358],[-117.19752566299996,34.057876730000032,390.23600000000442,0.070300000006682239],[-117.19745784399998,34.057897349000029,390.31200000000536,0.069699999992735684],[-117.19738660099995,34.057917920000079,390.35099999999511,0.070300000006682239],[-117.19732360699999,34.057936692000055,390.41999999999825,0.070300000006682239],[-117.19726149699994,34.05795570500004,390.52099999999336,0.069699999992735684],[-117.19719337399999,34.057976377000045,390.60300000000279,0.070300000006682239],[-117.19714298099996,34.057987618000027,390.65200000000186,0.070200000001932494],[-117.19717302399999,34.058060386000079,390.70299999999406,0.070399999996880069],[-117.19722244599996,34.058041944000024,390.30800000000454,0.069399999993038364],[-117.19736689799998,34.05799866600006,390.14699999999721,0.070300000006682239]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":8,\"PDOP\":3,\"VDOP\":2.7999999999999998,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19702730399996,34.05810137800006,390.4600000000064,0.069399999993038364],[-117.19707927999997,34.058090611000068,390.31100000000151,0.070300000006682239],[-117.19704782599996,34.058015623000074,390.45699999999488,0.070099999997182749],[-117.19699807599994,34.058033797000064,390.56900000000314,0.070000000006984919],[-117.19689665399994,34.058063962000062,390.6530000000057,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":9,\"PDOP\":2.8999999999999999,\"VDOP\":2.7999999999999998,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19689665799996,34.058065614000043,390.97299999999814,0.070000000006984919],[-117.19699852099995,34.058034527000075,390.8579999999929,0.070399999996880069],[-117.19704747099996,34.058016976000033,391.71499999999651,0.54600000000209548],[-117.19707810999995,34.058088158000032,390.78599999999278,0.070200000001932494],[-117.19702698499998,34.058099910000067,390.48799999999756,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":10,\"PDOP\":2.2999999999999998,\"VDOP\":2.1000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19709246799999,34.057827109000073,390.76200000000244,0.070099999997182749],[-117.19707910799997,34.057830750000051,390.68700000000536,0.070099999997182749]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":11,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19703710699997,34.057665297000028,391.22699999999895,0.070099999997182749],[-117.19717097199998,34.057624730000043,390.92500000000291,0.069699999992735684],[-117.19727240199995,34.057593462000057,390.77899999999499,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":12,\"PDOP\":3.7999999999999998,\"VDOP\":3.7000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19732847299997,34.057561651000071,390.55899999999383,0.069699999992735684],[-117.19725252099994,34.057584900000052,390.80800000000454,0.070200000001932494],[-117.19718006499994,34.057606154000041,390.88899999999558,0.069699999992735684],[-117.19713185199998,34.057620691000068,391.0570000000007,0.069399999993038364]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":13,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19711045599996,34.057571202000076,390.93700000000536,0.070300000006682239],[-117.19712964599995,34.057614814000033,390.86000000000058,0.069399999993038364]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.8999999999999999,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":14,\"PDOP\":5.0999999999999996,\"VDOP\":4.7000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19713967999996,34.057562744000052,390.92200000000594,0.070000000006984919],[-117.19715731499997,34.057606484000075,390.94100000000617,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":15,\"PDOP\":2,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19716715999999,34.05755514100008,390.94800000000396,0.070000000006984919],[-117.19718607999999,34.057597972000053,390.92799999999988,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":16,\"PDOP\":2.7000000000000002,\"VDOP\":2.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19719502499998,34.057546829000046,390.72599999999511,0.069799999997485429],[-117.19721253099999,34.057589489000065,390.72999999999593,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":17,\"PDOP\":3,\"VDOP\":2.7999999999999998,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19722289499998,34.057538664000049,390.71499999999651,0.070200000001932494],[-117.19724007699995,34.057580630000075,390.45799999999872,0.070300000006682239]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":18,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19725121799996,34.057529798000076,390.56699999999546,0.070000000006984919],[-117.19726806499995,34.057572166000057,390.61199999999371,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":19,\"PDOP\":2.7000000000000002,\"VDOP\":2.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19727830799997,34.057521422000036,390.57600000000093,0.070000000006984919],[-117.19729695099994,34.057564452000065,390.60199999999895,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":20,\"PDOP\":2,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19732482099994,34.057554885000059,390.4600000000064,0.069799999997485429],[-117.19730607299999,34.057512975000066,390.47800000000279,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":21,\"PDOP\":2,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19733283299996,34.057504553000058,390.43399999999383,0.069799999997485429],[-117.19735357399998,34.057547915000043,390.37399999999616,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":22,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19738114299997,34.057537572000058,390.29799999999523,0.069399999993038364],[-117.19736218999998,34.057495427000049,390.29799999999523,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":23,\"PDOP\":2.7000000000000002,\"VDOP\":2.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19740917499996,34.057529242000044,390.29200000000128,0.069799999997485429],[-117.19743642899999,34.057521300000076,390.2390000000014,0.070500000001629815],[-117.19742253399994,34.057489313000076,390.25400000000081,0.07060000000637956],[-117.19741972899999,34.057485771000074,390.24899999999616,0.070000000006984919],[-117.19741634699994,34.057483251000065,390.21300000000338,0.070000000006984919],[-117.19741110899997,34.057481761000076,390.23600000000442,0.070000000006984919],[-117.19740675299994,34.057481860000053,390.24099999999453,0.070000000006984919],[-117.19740447899994,34.057482920000041,390.25999999999476,0.070000000006984919],[-117.19740085299998,34.057484459000079,390.25800000000163,0.070000000006984919],[-117.19739787999998,34.057486108000035,390.25,0.070000000006984919],[-117.19739598899997,34.057488348000049,390.22299999999814,0.070000000006984919],[-117.19739526599994,34.057490701000063,390.24499999999534,0.069799999997485429],[-117.19739500799994,34.057492514000046,390.26900000000023,0.07060000000637956],[-117.19739521099996,34.057494667000071,390.28500000000349,0.069799999997485429],[-117.19739592699995,34.057498119000059,390.2960000000021,0.070000000006984919],[-117.19740891999999,34.057529488000057,390.30800000000454,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.5,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":24,\"PDOP\":3.2000000000000002,\"VDOP\":2.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19736301099999,34.057363343000077,390.34399999999732,0.069600000002537854],[-117.19733290099998,34.05737227700007,390.42299999999523,0.070399999996880069],[-117.19734827499997,34.057413318000044,390.42900000000373,0.069699999992735684],[-117.19734924399995,34.057419572000072,390.46199999999953,0.070200000001932494],[-117.19734649799994,34.057424340000068,390.44000000000233,0.070000000006984919],[-117.19734330399996,34.057426005000025,390.38999999999942,0.07060000000637956],[-117.19734039299999,34.057426915000065,390.45100000000093,0.070200000001932494],[-117.19733548399995,34.057427560000065,390.49099999999453,0.070000000006984919],[-117.19733062999995,34.057426946000078,390.39599999999336,0.070000000006984919],[-117.19732633599995,34.057424618000027,390.37799999999697,0.069699999992735684],[-117.19732355199994,34.057421784000041,390.45900000000256,0.070000000006984919],[-117.19732166899996,34.057418766000069,390.46600000000035,0.070000000006984919],[-117.19730685899998,34.057380379000051,390.54399999999441,0.070000000006984919],[-117.19725060999997,34.057396499000049,390.5789999999979,0.070000000006984919],[-117.19716732199998,34.057421153000064,390.8469999999943,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":25,\"PDOP\":4,\"VDOP\":3.7999999999999998,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19730119999997,34.057437103000041,390.38700000000244,0.070200000001932494],[-117.19728032599994,34.05739034000004,390.44500000000698,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":26,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19725282699994,34.057399727000075,390.46499999999651,0.07060000000637956],[-117.19727255599997,34.057446843000037,390.38000000000466,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":27,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19724458299999,34.057454689000053,390.55100000000675,0.070000000006984919],[-117.19722483699996,34.057407050000052,390.65200000000186,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":2.3999999999999999,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":28,\"PDOP\":7.0999999999999996,\"VDOP\":6.7000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19704835499999,34.057513276000066,391.01200000000244,0.069699999992735684],[-117.19702751999995,34.057464877000029,390.66800000000512,0.070300000006682239]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":29,\"PDOP\":2.7999999999999998,\"VDOP\":2.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19705542299994,34.057459058000063,390.26300000000629,0.070000000006984919],[-117.19707747999996,34.057504965000078,390.99400000000605,0.069699999992735684]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":30,\"PDOP\":2.7999999999999998,\"VDOP\":2.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19710470099994,34.057496620000052,390.86599999999453,0.070399999996880069],[-117.19708400799999,34.057447741000033,390.875,0.070399999996880069]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":31,\"PDOP\":3.8999999999999999,\"VDOP\":3.7000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19697311599998,34.057478607000064,393.57399999999325,0.87270000000717118],[-117.19703923999998,34.057460427000024,391.20100000000093,0.070300000006682239],[-117.19709131099995,34.057444023000073,391.08000000000175,0.069900000002235174],[-117.19716786099997,34.05742119100006,390.99400000000605,0.069799999997485429]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":32,\"PDOP\":1.8,\"VDOP\":1.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19770003899998,34.05726087000005,390.03100000000268,0.069900000002235174],[-117.19771240399996,34.057301562000077,390.37600000000384,0.54570000000239816],[-117.19771798599999,34.057302794000066,390.4030000000057,0.070000000006984919],[-117.19772150599999,34.057305258000042,390.41800000000512,0.070000000006984919],[-117.19772442999999,34.057306264000033,390.4539999999979,0.069900000002235174],[-117.19772761599995,34.057306806000042,390.4149999999936,0.070099999997182749],[-117.19773448099994,34.05730601700003,390.42699999999604,0.070000000006984919],[-117.19774062899995,34.057305560000032,390.40799999999581,0.070200000001932494],[-117.19774452799999,34.057303353000066,390.45600000000559,0.070200000001932494],[-117.19774735499999,34.057302550000031,390.4210000000021,0.070200000001932494],[-117.19774905799994,34.057300483000063,390.38700000000244,0.070500000001629815],[-117.19775083599995,34.057297892000065,390.40399999999499,0.069600000002537854],[-117.19775201299996,34.057293965000042,390.39400000000023,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":33,\"PDOP\":1.8,\"VDOP\":1.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19775196899997,34.057293827000024,390.38899999999558,0.070200000001932494],[-117.19775053299998,34.057194244000073,390.48399999999674,0.069600000002537854]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.69999999999999996,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":34,\"PDOP\":1.3999999999999999,\"VDOP\":1.2,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19774269699997,34.057453531000078,390.28699999999662,0.069900000002235174],[-117.19775353699998,34.05744969400007,390.34200000000419,0.069600000002537854],[-117.19775397499996,34.057440701000075,390.31900000000314,0.070000000006984919],[-117.19775235199995,34.057410036000078,390.30199999999604,0.070200000001932494],[-117.19775287899995,34.057392304000075,390.39400000000023,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":35,\"PDOP\":2.5,\"VDOP\":2.2999999999999998,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19775302499994,34.057392232000041,390.39699999999721,0.069900000002235174],[-117.19775137299996,34.057388317000061,390.38199999999779,0.069900000002235174],[-117.19774912899999,34.057386033000057,390.39999999999418,0.069900000002235174],[-117.19774719799995,34.057384353000032,390.41599999999744,0.069900000002235174],[-117.19774519599997,34.057383775000062,390.38700000000244,0.069900000002235174],[-117.19774192099999,34.057383199000071,390.38199999999779,0.069900000002235174],[-117.19773901699995,34.057382877000066,390.40399999999499,0.069900000002235174],[-117.19773611699998,34.05738389000004,390.41400000000431,0.069600000002537854],[-117.19773381499999,34.057385174000046,390.38999999999942,0.070500000001629815],[-117.19773195099998,34.057386381000072,390.41199999999662,0.069900000002235174],[-117.19773001799996,34.057388329000048,390.43700000000536,0.069900000002235174],[-117.19772860799998,34.057390610000027,390.41599999999744,0.070200000001932494],[-117.19772862599996,34.057394680000073,390.44199999999546,0.069900000002235174],[-117.19773577499996,34.057414465000079,390.43799999999464,0.069300000002840534],[-117.19774600899996,34.05743540900005,390.37799999999697,0.10580000000481959],[-117.19771076499995,34.05744687400005,390.32499999999709,0.069600000002537854]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":36,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19739972099995,34.056997673000069,390.75800000000163,0.72340000000258442],[-117.19744376399996,34.05712088100006,390.87300000000687,0.069799999997485429],[-117.19744527499995,34.057134365000024,390.41400000000431,0.069600000002537854],[-117.19744993399996,34.057191396000064,390.30199999999604,0.070200000001932494],[-117.19745214799997,34.057220889000064,390.16899999999441,0.069600000002537854],[-117.19745357499994,34.057247869000037,390.17399999999907,0.070200000001932494],[-117.19745649399999,34.057280496000033,390.11800000000221,0.069900000002235174],[-117.19745978199995,34.05731159100003,390.04200000000128,0.069900000002235174],[-117.19745916499994,34.05733529400004,389.99099999999453,0.070200000001932494],[-117.19746016699997,34.057373394000024,389.95100000000093,0.070200000001932494],[-117.19746105799999,34.057398878000072,389.90600000000268,0.070200000001932494],[-117.19746118999996,34.057423329000073,389.89999999999418,0.069300000002840534],[-117.19747296899999,34.057451998000033,389.89699999999721,0.070200000001932494],[-117.19750102799998,34.057515846000058,389.79200000000128,0.070300000006682239],[-117.19751534199997,34.057548629000053,389.90499999999884,0.070200000001932494],[-117.19752733999997,34.057577034000076,389.89500000000407,0.069600000002537854],[-117.19754085099999,34.057608963000064,389.92399999999907,0.069900000002235174],[-117.19755061999996,34.057635742000059,390.10099999999511,0.070200000001932494],[-117.19757049899999,34.057682881000062,389.30599999999686,0.73239999999350403]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":37,\"PDOP\":2.2000000000000002,\"VDOP\":2,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19758371199998,34.057701052000027,396.43099999999686,0.069900000002235174],[-117.19752738899996,34.057579197000052,389.86999999999534,0.069600000002537854]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":38,\"PDOP\":1.8999999999999999,\"VDOP\":1.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19782599799998,34.05750445700005,390.33699999999953,0.070200000001932494],[-117.19782313299999,34.057496650000076,390.375,0.069600000002537854],[-117.19781772799996,34.057489798000063,390.39400000000023,0.070200000001932494],[-117.19781329599999,34.057488032000037,390.41400000000431,0.070200000001932494],[-117.19780885799997,34.05748802100004,390.46400000000722,0.069600000002537854],[-117.19780408199995,34.057488669000065,390.41099999999278,0.070200000001932494],[-117.19779498599996,34.057491524000056,390.19599999999627,0.069900000002235174]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.8,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":39,\"PDOP\":3.2000000000000002,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19776965799997,34.057499030000031,390.26499999999942,0.070000000006984919],[-117.19776138899999,34.057501453000043,390.41400000000431,0.070200000001932494],[-117.19773925099997,34.057506887000045,390.24199999999837,0.069600000002537854],[-117.19770994699996,34.057516066000062,390.33000000000175,0.069600000002537854],[-117.19767668299994,34.057526888000041,390.32200000000012,0.070000000006984919],[-117.19764531499999,34.057535947000076,390.29499999999825,0.070000000006984919],[-117.19761501599999,34.057544567000036,390.24400000000605,0.069600000002537854],[-117.19758896999997,34.057553228000074,390.25500000000466,0.070500000001629815],[-117.19756344899997,34.057560670000044,390.20500000000175,0.069900000002235174],[-117.19754080599995,34.05756754500004,390.20299999999406,0.070500000001629815],[-117.19753505999995,34.057570977000069,390.17500000000291,0.070500000001629815],[-117.19753422699995,34.057576588000074,390.19100000000617,0.070500000001629815],[-117.19753876399994,34.057590685000037,389.92600000000675,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":40,\"PDOP\":1.3999999999999999,\"VDOP\":1.1000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19750534099995,34.057508628000051,390.02300000000105,0.069600000002537854],[-117.19751058199995,34.05752289000003,390.03399999999965,0.069600000002537854],[-117.19755978799998,34.057507718000068,390.13300000000163,0.070500000001629815],[-117.19760395599997,34.057495536000033,390.22299999999814,0.070000000006984919],[-117.19764370499996,34.057482978000053,390.21099999999569,0.070000000006984919],[-117.19768367799998,34.057471367000062,390.30999999999767,0.069600000002537854],[-117.19774162099998,34.057453613000064,390.27199999999721,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.5,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":41,\"PDOP\":2.3999999999999999,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19749296199996,34.057511826000052,390.09600000000501,0.070300000006682239],[-117.19749845299998,34.057527084000071,390.04799999999523,0.070000000006984919],[-117.19746255699999,34.057537987000046,390.2329999999929,0.070500000001629815],[-117.19740115999997,34.057556500000032,390.44700000000012,0.070500000001629815],[-117.19734297299999,34.057573915000035,390.56900000000314,0.069600000002537854],[-117.19727312199996,34.057595262000063,390.62600000000384,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":42,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19727650999999,34.057595320000075,390.62099999999919,0.069600000002537854],[-117.19728671299998,34.057615163000037,390.58100000000559,0.069600000002537854]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":43,\"PDOP\":1.6000000000000001,\"VDOP\":1.3999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19728135999998,34.05761749100003,390.55299999999988,0.069600000002537854],[-117.19729269299995,34.057613164000031,390.47500000000582,0.070000000006984919]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":44,\"PDOP\":1.7,\"VDOP\":1.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19734045799999,34.057598655000049,390.36299999999756,0.072899999999208376],[-117.19735550899998,34.057593642000029,390.32200000000012,0.070500000001629815]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":45,\"PDOP\":1.7,\"VDOP\":1.5,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19734890499996,34.057596948000025,390.38199999999779,0.069600000002537854],[-117.19733920399995,34.05757574200004,390.4539999999979,0.070500000001629815]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.5,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":46,\"PDOP\":2.6000000000000001,\"VDOP\":2.1000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19734841799999,34.057596706000027,390.48099999999977,0.070200000001932494],[-117.19735819199997,34.057619514000066,390.4320000000007,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":47,\"PDOP\":1.6000000000000001,\"VDOP\":1.3999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19740242199998,34.057579317000034,390.31900000000314,0.070000000006984919],[-117.19741691799999,34.057575182000051,390.22599999999511,0.069600000002537854]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":48,\"PDOP\":1.8999999999999999,\"VDOP\":1.7,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19741051899996,34.057577026000047,390.24700000000303,0.069600000002537854],[-117.19740132399994,34.057556792000071,390.2609999999986,0.070500000001629815]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":49,\"PDOP\":1.8,\"VDOP\":1.6000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19746607399998,34.057560876000025,390.08699999999953,0.070200000001932494],[-117.19747129499996,34.057558859000039,390.07200000000012,0.069600000002537854],[-117.19746268699998,34.057537521000029,390.10400000000664,0.070200000001932494]]],\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.2,\"LAT_RMS\":null,\"LON_RMS\":null,\"ObjectID\":50,\"PDOP\":2.5,\"VDOP\":2.2000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.19748631499999,34.057642328000043,390.14100000000326,0.069699999992735684],[-117.19748233799999,34.057632787000045,390.24700000000303,0.069699999992735684],[-117.19747474999997,34.057615717000033,390.16300000000047,0.070300000006682239],[-117.19747249299996,34.057611865000069,390.29200000000128,0.070500000001629815],[-117.19746897199997,34.057609601000024,390.30899999999383,0.070200000001932494],[-117.19746595599997,34.05760796900006,390.28800000000047,0.070200000001932494],[-117.19746182899996,34.05760587900005,390.27899999999499,0.070200000001932494],[-117.19745619699995,34.057604424000033,390.27400000000489,0.069600000002537854],[-117.19745020099998,34.057604737000077,390.2899999999936,0.069600000002537854],[-117.19744494699995,34.05760411600005,390.30899999999383,0.069600000002537854],[-117.19743881399995,34.057605764000073,390.29799999999523,0.069600000002537854],[-117.19743073099994,34.05760712600005,390.33400000000256,0.069600000002537854],[-117.19739076299999,34.057619180000074,390.1820000000007,0.069499999997788109],[-117.19736187999996,34.057631660000027,390.26200000000244,0.07189999999536667]]],\"spatialReference\":{\"wkid\":4326}}}],\"geometryType\":\"esriGeometryPolyline\"},\"layerDefinition\":{\"allowGeometryUpdates\":true,\"capabilities\":\"Create,Delete,Query,Update,Editing\",\"defaultVisibility\":true,\"drawingInfo\":{\"renderer\":{\"symbol\":{\"color\":[255,0,0,255],\"style\":\"esriSLSSolid\",\"type\":\"esriSLS\",\"width\":1.5},\"type\":\"simple\"},\"transparency\":0},\"extent\":{\"xmin\":-117.19782599799998,\"ymin\":34.056997673000069,\"xmax\":-117.19677084399996,\"ymax\":34.05810137800006,\"zmin\":0,\"zmax\":402.59600000000501,\"mmin\":0.069300000002840534,\"mmax\":2.5524000000004889,\"spatialReference\":{\"wkid\":4326}},\"fields\":[{\"alias\":\"Point DOP\",\"editable\":true,\"length\":0,\"name\":\"PDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Horizontal DOP\",\"editable\":true,\"length\":0,\"name\":\"HDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical DOP\",\"editable\":true,\"length\":0,\"name\":\"VDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Longitude Error\",\"editable\":true,\"length\":0,\"name\":\"LON_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Latitude Error\",\"editable\":true,\"length\":0,\"name\":\"LAT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical Error\",\"editable\":true,\"length\":0,\"name\":\"VERT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Fix Type\",\"editable\":true,\"length\":50,\"name\":\"FIX_TYPE\",\"nullable\":true,\"type\":\"esriFieldTypeString\"},{\"editable\":false,\"length\":0,\"name\":\"ObjectID\",\"nullable\":false,\"type\":\"esriFieldTypeOID\"}],\"geometryType\":\"esriGeometryPolyline\",\"hasM\":true,\"hasZ\":true,\"hasAttachments\":false,\"isDataVersioned\":false,\"spatialReference\":{\"wkid\":4326},\"supportsAdvancedQueries\":false,\"supportsRollbackOnFailureParameter\":false,\"supportsStatistics\":false},\"nextObjectId\":51},{\"featureSet\":{\"features\":[{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.8999999999999999,\"LAT_RMS\":0.049000000000000002,\"LON_RMS\":0.050000000000000003,\"ObjectID\":1,\"PDOP\":5.0999999999999996,\"VDOP\":4.7000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19713973599994,\"y\":34.057562766000046,\"z\":390.92600000000675,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.8999999999999999,\"LAT_RMS\":0.049000000000000002,\"LON_RMS\":0.050000000000000003,\"ObjectID\":2,\"PDOP\":5.0999999999999996,\"VDOP\":4.7000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19713959799998,\"y\":34.057562852000046,\"z\":390.9320000000007,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.8999999999999999,\"LAT_RMS\":0.049000000000000002,\"LON_RMS\":0.050000000000000003,\"ObjectID\":3,\"PDOP\":5.0999999999999996,\"VDOP\":4.7000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19713971099998,\"y\":34.057562789000031,\"z\":390.91700000000128,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042999999999999997,\"ObjectID\":4,\"PDOP\":2.7000000000000002,\"VDOP\":2.5,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19738105099998,\"y\":34.057538033000071,\"z\":390.29200000000128,\"m\":0.07060000000637956,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.041000000000000002,\"ObjectID\":5,\"PDOP\":2.6000000000000001,\"VDOP\":2.3999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19738118999999,\"y\":34.057537579000041,\"z\":390.30199999999604,\"m\":0.069399999993038364,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.040000000000000001,\"ObjectID\":6,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19736295999996,\"y\":34.057363322000072,\"z\":390.35000000000582,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":7,\"PDOP\":2,\"VDOP\":1.8,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19724459699995,\"y\":34.057454469000049,\"z\":390.53699999999662,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.6000000000000001,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":8,\"PDOP\":3.2999999999999998,\"VDOP\":2.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19721684399997,\"y\":34.057462696000073,\"z\":390.62900000000081,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042999999999999997,\"ObjectID\":9,\"PDOP\":3.2000000000000002,\"VDOP\":3.1000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19718896999996,\"y\":34.057471867000061,\"z\":390.76200000000244,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":10,\"PDOP\":4,\"VDOP\":3.7999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19716093399995,\"y\":34.057480158000033,\"z\":390.77499999999418,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":11,\"PDOP\":3.8999999999999999,\"VDOP\":3.7999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19713283699997,\"y\":34.057488528000079,\"z\":390.85000000000582,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":12,\"PDOP\":3.8999999999999999,\"VDOP\":3.7999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19710451199995,\"y\":34.057496268000079,\"z\":390.90600000000268,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042999999999999997,\"ObjectID\":13,\"PDOP\":2.7000000000000002,\"VDOP\":2.5,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19707706599996,\"y\":34.057505243000037,\"z\":390.95799999999872,\"m\":0.07060000000637956,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.5,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":14,\"PDOP\":3.2000000000000002,\"VDOP\":2.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19704841199996,\"y\":34.057513129000029,\"z\":390.97999999999593,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"DgpsFix\",\"HDOP\":1,\"LAT_RMS\":0.58499999999999996,\"LON_RMS\":0.57599999999999996,\"ObjectID\":15,\"PDOP\":2.2000000000000002,\"VDOP\":1.8999999999999999,\"VERT_RMS\":1.532},\"geometry\":{\"x\":-117.19697134499995,\"y\":34.057479482000076,\"z\":392.17900000000373,\"m\":0.82099999999627471,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.7,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.037999999999999999,\"ObjectID\":16,\"PDOP\":4.5999999999999996,\"VDOP\":4.2999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19738404199995,\"y\":34.057413476000079,\"z\":390.37900000000081,\"m\":0.069300000002840534,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.7,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.037999999999999999,\"ObjectID\":17,\"PDOP\":4.5999999999999996,\"VDOP\":4.2999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19741194499994,\"y\":34.057405661000075,\"z\":390.33699999999953,\"m\":0.069300000002840534,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.7,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":18,\"PDOP\":4.5999999999999996,\"VDOP\":4.2999999999999998,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19743984499996,\"y\":34.057397149000053,\"z\":390.30199999999604,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.040000000000000001,\"ObjectID\":19,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19746613299998,\"y\":34.057388763000063,\"z\":390.0109999999986,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.040000000000000001,\"ObjectID\":20,\"PDOP\":1.8999999999999999,\"VDOP\":1.7,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19749462099998,\"y\":34.057379838000031,\"z\":390.08800000000338,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.040000000000000001,\"ObjectID\":21,\"PDOP\":2.5,\"VDOP\":2.3999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19752292699997,\"y\":34.057370840000033,\"z\":390.0969999999943,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.041000000000000002,\"ObjectID\":22,\"PDOP\":3.7999999999999998,\"VDOP\":3.7000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19755139699998,\"y\":34.057362698000077,\"z\":390.14599999999336,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.040000000000000001,\"ObjectID\":23,\"PDOP\":1.8999999999999999,\"VDOP\":1.7,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19757927899997,\"y\":34.057354356000076,\"z\":390.12699999999313,\"m\":0.070500000001629815,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.040000000000000001,\"ObjectID\":24,\"PDOP\":1.8999999999999999,\"VDOP\":1.7,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19760710299994,\"y\":34.057346231000054,\"z\":390.1359999999986,\"m\":0.070500000001629815,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.040000000000000001,\"ObjectID\":25,\"PDOP\":2.6000000000000001,\"VDOP\":2.3999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19763463699996,\"y\":34.057338104000053,\"z\":390.20699999999488,\"m\":0.070500000001629815,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.039,\"ObjectID\":26,\"PDOP\":1.8,\"VDOP\":1.5,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19766288699998,\"y\":34.057329310000057,\"z\":390.21899999999732,\"m\":0.069900000002235174,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":27,\"PDOP\":1.8,\"VDOP\":1.5,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19769024199996,\"y\":34.057321091000063,\"z\":390.18700000000536,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058000000000000003,\"LON_RMS\":0.039,\"ObjectID\":28,\"PDOP\":1.8,\"VDOP\":1.6000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19773112199999,\"y\":34.05730109700005,\"z\":391.30599999999686,\"m\":0.069900000002235174,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.2,\"LAT_RMS\":0.040000000000000001,\"LON_RMS\":0.058000000000000003,\"ObjectID\":29,\"PDOP\":2.7999999999999998,\"VDOP\":2.5,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19769713399995,\"y\":34.057395172000042,\"z\":390.19100000000617,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.057000000000000002,\"LON_RMS\":0.040000000000000001,\"ObjectID\":30,\"PDOP\":2.2000000000000002,\"VDOP\":1.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19767009499998,\"y\":34.057403623000027,\"z\":390.12099999999919,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":31,\"PDOP\":2.6000000000000001,\"VDOP\":2.3999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19764167599999,\"y\":34.057412147000036,\"z\":390.1140000000014,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":32,\"PDOP\":2.3999999999999999,\"VDOP\":2.2000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19761329999994,\"y\":34.057420213000057,\"z\":390.0679999999993,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":33,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19758431499997,\"y\":34.057429016000071,\"z\":390.09600000000501,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":34,\"PDOP\":2.3999999999999999,\"VDOP\":2.2000000000000002,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19755634899997,\"y\":34.057437917000073,\"z\":390.0170000000071,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":35,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19752916499999,\"y\":34.057446475000063,\"z\":390.00999999999476,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.3999999999999999,\"LAT_RMS\":0.056000000000000001,\"LON_RMS\":0.042000000000000003,\"ObjectID\":36,\"PDOP\":3.6000000000000001,\"VDOP\":3.2999999999999998,\"VERT_RMS\":0.075999999999999998},\"geometry\":{\"x\":-117.19750128799996,\"y\":34.057453453000051,\"z\":389.98399999999674,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":37,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19747336699999,\"y\":34.057462661000045,\"z\":390.00199999999313,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":38,\"PDOP\":2.7999999999999998,\"VDOP\":2.6000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19744543899998,\"y\":34.057470308000063,\"z\":390.11800000000221,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"DgpsFix\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":0.54300000000000004,\"LON_RMS\":0.47199999999999998,\"ObjectID\":39,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":1.294},\"geometry\":{\"x\":-117.19740250099994,\"y\":34.056999103000066,\"z\":391.99000000000524,\"m\":0.71950000000651926,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"DgpsFix\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.54300000000000004,\"LON_RMS\":0.47099999999999997,\"ObjectID\":40,\"PDOP\":1.7,\"VDOP\":1.3999999999999999,\"VERT_RMS\":1.296},\"geometry\":{\"x\":-117.19740315099995,\"y\":34.056999792000056,\"z\":392.0679999999993,\"m\":0.71880000000237487,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"DgpsFix\",\"HDOP\":0.80000000000000004,\"LAT_RMS\":0.71599999999999997,\"LON_RMS\":0.61399999999999999,\"ObjectID\":41,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":1.6020000000000001},\"geometry\":{\"x\":-117.19757378299994,\"y\":34.057684962000053,\"z\":389.85899999999674,\"m\":0.94319999999424908,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.065000000000000002,\"LON_RMS\":0.025000000000000001,\"ObjectID\":42,\"PDOP\":1.7,\"VDOP\":1.3999999999999999,\"VERT_RMS\":0.13},\"geometry\":{\"x\":-117.19758369999994,\"y\":34.057701197000029,\"z\":396.43300000000454,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.037999999999999999,\"ObjectID\":43,\"PDOP\":2.1000000000000001,\"VDOP\":1.8999999999999999,\"VERT_RMS\":0.079000000000000001},\"geometry\":{\"x\":-117.19776892599998,\"y\":34.057499028000052,\"z\":390.1820000000007,\"m\":0.070200000001932494,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.69999999999999996,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.036999999999999998,\"ObjectID\":44,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19776195699995,\"y\":34.057501331000026,\"z\":390.35199999999895,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1.7,\"LAT_RMS\":0.059999999999999998,\"LON_RMS\":0.035999999999999997,\"ObjectID\":45,\"PDOP\":4.5,\"VDOP\":4.2000000000000002,\"VERT_RMS\":0.085999999999999993},\"geometry\":{\"x\":-117.19699562399995,\"y\":34.05766441600008,\"z\":391.90200000000186,\"m\":0.070000000006984919,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"DgpsFix\",\"HDOP\":0.69999999999999996,\"LAT_RMS\":0.56200000000000006,\"LON_RMS\":0.41199999999999998,\"ObjectID\":46,\"PDOP\":1.3,\"VDOP\":1.1000000000000001,\"VERT_RMS\":1.2090000000000001},\"geometry\":{\"x\":-117.19696698399997,\"y\":34.05759878300006,\"z\":392.36500000000524,\"m\":0.69680000000516884,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":0.90000000000000002,\"LAT_RMS\":0.058999999999999997,\"LON_RMS\":0.036999999999999998,\"ObjectID\":47,\"PDOP\":1.5,\"VDOP\":1.3,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19682315199998,\"y\":34.057859110000038,\"z\":402.52700000000186,\"m\":0.069600000002537854,\"spatialReference\":{\"wkid\":4326}}},{\"attributes\":{\"FIX_TYPE\":\"FloatRtk\",\"HDOP\":1,\"LAT_RMS\":0.060999999999999999,\"LON_RMS\":0.035000000000000003,\"ObjectID\":48,\"PDOP\":1.8999999999999999,\"VDOP\":1.6000000000000001,\"VERT_RMS\":0.070000000000000007},\"geometry\":{\"x\":-117.19682180699999,\"y\":34.057860364000078,\"z\":403.58800000000338,\"m\":0.070300000006682239,\"spatialReference\":{\"wkid\":4326}}}],\"geometryType\":\"esriGeometryPoint\"},\"layerDefinition\":{\"allowGeometryUpdates\":true,\"capabilities\":\"Create,Delete,Query,Update,Editing\",\"defaultVisibility\":true,\"drawingInfo\":{\"renderer\":{\"symbol\":{\"angle\":0,\"color\":[255,0,0,255],\"size\":6,\"style\":\"esriSMSCircle\",\"type\":\"esriSMS\",\"xoffset\":0,\"yoffset\":0},\"type\":\"simple\"},\"transparency\":0},\"extent\":{\"xmin\":-117.19776892599998,\"ymin\":34.056999103000066,\"xmax\":-117.19682180699999,\"ymax\":34.057860364000078,\"zmin\":0,\"zmax\":403.58800000000338,\"mmin\":0.069300000002840534,\"mmax\":0.94319999999424908,\"spatialReference\":{\"wkid\":4326}},\"fields\":[{\"alias\":\"Point DOP\",\"editable\":true,\"length\":0,\"name\":\"PDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Horizontal DOP\",\"editable\":true,\"length\":0,\"name\":\"HDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical DOP\",\"editable\":true,\"length\":0,\"name\":\"VDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Longitude Error\",\"editable\":true,\"length\":0,\"name\":\"LON_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Latitude Error\",\"editable\":true,\"length\":0,\"name\":\"LAT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical Error\",\"editable\":true,\"length\":0,\"name\":\"VERT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Fix Type\",\"editable\":true,\"length\":50,\"name\":\"FIX_TYPE\",\"nullable\":true,\"type\":\"esriFieldTypeString\"},{\"editable\":false,\"length\":0,\"name\":\"ObjectID\",\"nullable\":false,\"type\":\"esriFieldTypeOID\"}],\"geometryType\":\"esriGeometryPoint\",\"hasM\":true,\"hasZ\":true,\"hasAttachments\":false,\"isDataVersioned\":false,\"spatialReference\":{\"wkid\":4326},\"supportsAdvancedQueries\":false,\"supportsRollbackOnFailureParameter\":false,\"supportsStatistics\":false},\"nextObjectId\":49}],\"showLegend\":true}";
            json = json.Replace("{\"wkid\":4326}", "{\"wkid\":6318}");
            var fc = Esri.ArcGISRuntime.Data.FeatureCollection.FromJson(json);
            var fl = new FeatureCollectionLayer(fc);
            Scene.OperationalLayers.Add(fl);

            json = "{\"layers\":[{\"featureSet\":{\"features\":[{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":2.5,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":2,\"PDOP\":6,\"VDOP\":5.4000000000000004,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18285469799997,34.051007894000065,389.09299999999348,0.12179999999352731],[-117.18281192299997,34.051027293000061,388.84500000000116,0.0099999999947613105],[-117.18278206299999,34.051044291000039,388.8859999999986,0.016300000002956949],[-117.18274134599994,34.05106264300008,386.97699999999895,0.10340000000724103]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.3999999999999999,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":3,\"PDOP\":3.1000000000000001,\"VDOP\":2.7000000000000002,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18276413699999,34.051024305000055,388.92200000000594,0.0093999999953666702],[-117.18278203999995,34.051044463000039,388.85700000000361,0.025599999993573874],[-117.18279811599996,34.051062990000048,389.06699999999546,0.014100000000325963]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.3,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":4,\"PDOP\":2.7000000000000002,\"VDOP\":2.3999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18279185899996,34.051004825000064,388.79099999999744,0.040500000002793968],[-117.18281231999998,34.051027442000077,388.63700000000244,0.013500000000931323],[-117.18282813199994,34.051044900000079,388.72100000000501,0.039199999999254942]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.3,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":5,\"PDOP\":2.2999999999999998,\"VDOP\":1.8999999999999999,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18277172399996,34.051017983000065,390.33199999999488,0.05319999999483116],[-117.18279145699995,34.051004148000061,388.88000000000466,0.0093999999953666702],[-117.18281205199997,34.050988355000072,388.85700000000361,0.043600000004516914]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":6,\"PDOP\":2.3999999999999999,\"VDOP\":2.1000000000000001,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18282124099994,34.050989716000061,388.4429999999993,0.088099999993573874],[-117.18283264599995,34.051004061000071,388.68799999999464,0.093500000002677552],[-117.18283402399999,34.051003792000074,389.31699999999546,0.10289999999804422],[-117.18285374199996,34.051005131000068,389.6649999999936,0.024699999994481914],[-117.18286507399995,34.051010266000048,388.83800000000338,0.02659999999741558],[-117.18287561199998,34.051022300000056,389.23500000000058,0.056599999996251427]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":7,\"PDOP\":2.1000000000000001,\"VDOP\":1.8,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18275939399996,34.051015739000036,388.92299999999523,0.010299999994458631],[-117.18273597299998,34.050988584000038,388.93300000000454,0.012199999997392297],[-117.18269490699998,34.051012123000078,389.21199999999953,0.037500000005820766],[-117.18271411899997,34.051036949000036,388.02599999999802,0.14070000000356231],[-117.18275879899994,34.051015493000079,388.84100000000035,0.013900000005378388]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}},{\"attributes\":{\"FIX_TYPE\":\"Fix3D\",\"HDOP\":1.1000000000000001,\"LAT_RMS\":null,\"LON_n\":null,\"ObjectID\":8,\"PDOP\":2.1000000000000001,\"VDOP\":1.8,\"VERT_RMS\":null},\"geometry\":{\"hasZ\":true,\"hasM\":true,\"paths\":[[[-117.18275936599997,34.051016412000024,388.97100000000501,0.01750000000174623],[-117.18276616699995,34.051023204000046,388.91700000000128,0.024399999994784594],[-117.18274456199998,34.05104338700005,389.92299999999523,0.076600000000325963],[-117.18273306299994,34.051033860000075,389.35300000000279,0.085800000000745058],[-117.18276054899997,34.051014958000053,388.74300000000221,0.12249999999767169]]],\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}}}],\"geometryType\":\"esriGeometryPolyline\"},\"layerDefinition\":{\"allowGeometryUpdates\":true,\"capabilities\":\"Create,Delete,Query,Update,Editing\",\"defaultVisibility\":true,\"drawingInfo\":{\"renderer\":{\"symbol\":{\"color\":[255,0,0,255],\"style\":\"esriSLSSolid\",\"type\":\"esriSLS\",\"width\":1.5},\"type\":\"simple\"},\"transparency\":0},\"extent\":{\"xmin\":-117.18287561199998,\"ymin\":34.050988355000072,\"xmax\":-117.18269490699998,\"ymax\":34.051062990000048,\"zmin\":0,\"zmax\":390.33199999999488,\"mmin\":0.0071999999927356839,\"mmax\":0.14070000000356231,\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}},\"fields\":[{\"alias\":\"Point DOP\",\"editable\":true,\"length\":0,\"name\":\"PDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Horizontal DOP\",\"editable\":true,\"length\":0,\"name\":\"HDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical DOP\",\"editable\":true,\"length\":0,\"name\":\"VDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Longitude Error\",\"editable\":true,\"length\":0,\"name\":\"LON_n\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Latitude Error\",\"editable\":true,\"length\":0,\"name\":\"LAT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical Error\",\"editable\":true,\"length\":0,\"name\":\"VERT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Fix Type\",\"editable\":true,\"length\":50,\"name\":\"FIX_TYPE\",\"nullable\":true,\"type\":\"esriFieldTypeString\"},{\"editable\":false,\"length\":0,\"name\":\"ObjectID\",\"nullable\":false,\"type\":\"esriFieldTypeOID\"}],\"geometryType\":\"esriGeometryPolyline\",\"hasM\":true,\"hasZ\":true,\"hasAttachments\":false,\"isDataVersioned\":false,\"objectIdField\":\"ObjectID\",\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318},\"supportsAdvancedQueries\":false,\"supportsRollbackOnFailureParameter\":false,\"supportsStatistics\":false,\"spatialReference\":{\"latestWkid\":6318,\"wkid\":104145}},\"nextObjectId\":9},{\"featureSet\":{\"features\":[],\"geometryType\":\"esriGeometryPoint\"},\"layerDefinition\":{\"allowGeometryUpdates\":true,\"capabilities\":\"Create,Delete,Query,Update,Editing\",\"defaultVisibility\":true,\"drawingInfo\":{\"renderer\":{\"symbol\":{\"angle\":0,\"color\":[255,0,0,255],\"size\":6,\"style\":\"esriSMSCircle\",\"type\":\"esriSMS\",\"xoffset\":0,\"yoffset\":0},\"type\":\"simple\"},\"transparency\":0},\"extent\":{\"xmin\":null,\"ymin\":null,\"xmax\":null,\"ymax\":null,\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318}},\"fields\":[{\"alias\":\"Point DOP\",\"editable\":true,\"length\":0,\"name\":\"PDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Horizontal DOP\",\"editable\":true,\"length\":0,\"name\":\"HDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical DOP\",\"editable\":true,\"length\":0,\"name\":\"VDOP\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Longitude Error\",\"editable\":true,\"length\":0,\"name\":\"LON_n\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Latitude Error\",\"editable\":true,\"length\":0,\"name\":\"LAT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Vertical Error\",\"editable\":true,\"length\":0,\"name\":\"VERT_RMS\",\"nullable\":true,\"type\":\"esriFieldTypeDouble\"},{\"alias\":\"Fix Type\",\"editable\":true,\"length\":50,\"name\":\"FIX_TYPE\",\"nullable\":true,\"type\":\"esriFieldTypeString\"},{\"editable\":false,\"length\":0,\"name\":\"ObjectID\",\"nullable\":false,\"type\":\"esriFieldTypeOID\"}],\"geometryType\":\"esriGeometryPoint\",\"hasM\":true,\"hasZ\":true,\"hasAttachments\":false,\"isDataVersioned\":false,\"objectIdField\":\"ObjectID\",\"spatialReference\":{\"wkid\":104145,\"latestWkid\":6318},\"supportsAdvancedQueries\":false,\"supportsRollbackOnFailureParameter\":false,\"supportsStatistics\":false,\"spatialReference\":{\"latestWkid\":6318,\"wkid\":104145}}}],\"showLegend\":true}";
            fc = Esri.ArcGISRuntime.Data.FeatureCollection.FromJson(json);
            fl = new FeatureCollectionLayer(fc);
            Scene.OperationalLayers.Add(fl);

            try
            {
                await Scene.LoadAsync();
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, "Failed to load scene: \n" + ex.Message, ToastLength.Long).Show();
                return;
            }
            ARView.Scene = Scene;
        }

        private void ARView_ViewpointChanged(object sender, EventArgs e)
        {
            headingReadout.Text = $"Heading: {ARView.Camera.Heading.ToString("0")}°";
        }

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            menu.Add(Menu.None, 1, Menu.None, "Toggle Calibration Settings");
            menu.Add(Menu.None, 2, Menu.None, "Toggle Basemap");

            return true;
        }

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == 1)
            {
                var settingsView = FindViewById<LinearLayout>(Resource.Id.settingsView);
                settingsView.Visibility = (settingsView.Visibility == ViewStates.Visible) ? ViewStates.Invisible : ViewStates.Visible;                
            }
            if (item.ItemId == 2)
            {
                Scene.Basemap.BaseLayers[0].IsVisible = !Scene.Basemap.BaseLayers[0].IsVisible;
            }
            return true;
        }

        [Java.Interop.Export("btnSurfaceClick")]
        public void btnSurfaceClick(View v) => SnapToSurface(ARView.Camera?.Location);
        [Java.Interop.Export("btnUpClick")]
        public void btnUpClick(View v) => AdjustElevation(1);
        [Java.Interop.Export("btnDownClick")]
        public void btnDownClick(View v) => AdjustElevation(-1);

        private async void SnapToSurface(MapPoint location)
        {
            if (location == null) return;
            if (Scene?.Basemap?.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
            {
                try
                {
                    double deviceElevationAboveTerrain = defaultDeviceElevationAboveTerrain;
                    // Perform hittest at center of screen against detected surfaces to estimate device elevation above terrain
                    var mp = ARView.ARScreenToLocation(new global::Android.Graphics.PointF(ARView.Width * .5f, ARView.Height * .5f));
                    if (mp != null)
                        deviceElevationAboveTerrain = ARView.Camera.Location.Z - mp.Z;

                    double elevation = await Scene.BaseSurface.GetElevationAsync(location);
                    location = new MapPoint(location.X, location.Y, elevation + deviceElevationAboveTerrain, location.SpatialReference);
                    ARView.OriginCamera = ARView.OriginCamera.MoveTo(location);
                    ARView.ResetTracking();
                }
                catch (Exception ex)
                {
                    Toast.MakeText(this, "Failed to snap location to terrain\n" + ex.Message, ToastLength.Short).Show();
                }
            }
        }

        private void AdjustElevation(double deltaElevation)
        {
            ARView.SetInitialTransformation(ARView.InitialTransformation + TransformationMatrix.Create(0, 0, 0, 1, 0, -deltaElevation, 0));
        }
    }
}